package com.zoo.sys.common;

import com.zoo.sys.realm.JwtUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @Author: WangB
 * @Date: 2022/3/23
 */
public class SecurityUtil {


    public static JwtUser  getUserOfSecurityContext(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        return (JwtUser) authentication.getPrincipal();
    }



}
